<?php
// get the parameter file
$ini_param = parse_ini_file("param.ini");

//error levels
// 1 critical error
// 2 general error
// 3 warning (default)

function debug_log($error_string, $error_level = 3)
{
	if($ini_param['log_level'] < $error_level)
	{
		return;
	}
	else
	{
		//create error string
		
		
		
		$filename = date("Ymd");   

		//open file
		//if cannot open file, create file		
		$file = fopen($filename, "ab");
		

		//append to file
		fwrite($file, $error);
		
		fclose($file);
		
	}

}
?>